<?php

namespace App\Http\Middleware;

use Jenssegers\Agent\Agent;
use Closure;

class ToHome
{

    public function handle($request, Closure $next)
    {
        $agent = new Agent();
        if($agent->isMobile()){
            return $next($request);
        }else{
            return redirect(route('home.index.index'));
        }
    }
}
